package com.gengzp.rpc.enums;

/**
 * @ClassName RpcServiceRegisterIpTypeEnum
 * @Description rpc框架服务注册 ip 类型枚举
 * @Author gengzp
 * @Date 2025/9/23 17:56
 */
public enum RpcServiceRegisterIpTypeEnum {

    /**
     * 内网ip
     */
    INNER("inner", "内网ip"),

    /**
     * 公网ip
     */
    OUTER("outer", "公网ip"),
    ;

    private final String name;

    private final String description;

    RpcServiceRegisterIpTypeEnum(String name, String description) {
        this.name = name;
        this.description = description;
    }

    public String getName() {
        return name;
    }

    public String getDescription() {
        return description;
    }

    public static RpcServiceRegisterIpTypeEnum getByName(String name) {
        for (RpcServiceRegisterIpTypeEnum value : values()) {
            if (value.name.equals(name)) {
                return value;
            }
        }
        return null;
    }

}
